<template>
  <div class="navsed">
    <div class="navseds">
      <el-row :gutter="8">
        <el-col :span="4">
          <router-link to="/bussiens?status=1">
            <el-card>
              <el-row type="flex" justify="center" align="middle">
                  <el-col :span="9"><div class="hmIco"><img src='https://51shanxiao.com/images/icon1.png' /></div></el-col>
                  <el-col :span="15">
                  <div>
                      <p class="font30">{{info.submitCount}}</p>
                      <h3 class="font14">待审核商机</h3>
                  </div>
                  </el-col>
              </el-row>
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/bussiens?status=2">
            <el-card>
              <el-row type="flex" justify="center" align="middle">
                  <el-col :span="9"><div class="hmIco"><img src='https://51shanxiao.com/images/icon2.png' /></div></el-col>
                  <el-col :span="15">
                  <div>
                      <p class="font30">{{info.passCount}}</p>
                      <h3 class="font14">已通过商机</h3>
                  </div>
                  </el-col>
              </el-row>
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/bussiens?status=3">
            <el-card>
              <el-row type="flex" justify="center" align="middle">
                  <el-col :span="9"><div class="hmIco"><img src='https://51shanxiao.com/images/icon3.png' /></div></el-col>
                  <el-col :span="15">
                  <div>
                      <p class="font30">{{info.rejectCount}}</p>
                      <h3 class="font14">已拒绝商机</h3>
                  </div>
                  </el-col>
              </el-row>
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/bussiens?status=4">
            <el-card>
              <el-row type="flex" justify="center" align="middle">
                  <el-col :span="9"><div class="hmIco"><img src='https://51shanxiao.com/images/icon4.png' /></div></el-col>
                  <el-col :span="15">
                  <div>
                      <p class="font30">{{info.awaitCount}}</p>
                      <h3 class="font14">已引荐商机</h3>
                  </div>
                  </el-col>
              </el-row>
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/bussiens?status=7">
            <el-card>
              <el-row type="flex" justify="center" align="middle">
                  <el-col :span="9"><div class="hmIco"><img src='https://51shanxiao.com/images/icon5.png' /></div></el-col>
                  <el-col :span="15">
                  <div>
                      <p class="font30">{{info.signCount}}</p>
                      <h3 class="font14">已签单商机</h3>
                  </div>
                  </el-col>
              </el-row>
            </el-card>
          </router-link>
        </el-col>
        <el-col :span="4">
          <router-link to="/bussiens?status=9">
            <el-card>
              <el-row type="flex" justify="center" align="middle">
                  <el-col :span="9"><div class="hmIco"><img src='https://51shanxiao.com/images/icon6.png' /></div></el-col>
                  <el-col :span="15">
                  <div>
                      <p class="font30">{{info.moneyBackCount}}</p>
                      <h3 class="font14">已回款商机</h3>
                  </div>
                  </el-col>
              </el-row>
            </el-card>
          </router-link>
        </el-col>
      </el-row>
    </div>
    <div class="navseds2">
      <div class="font20">产品中心</div>
      <el-row :gutter="20">

        <el-col :span="12" v-for="(item,index) in tableData" :key="index">
          <router-link :to='"/productdetail?id="+item.id'>
             <el-row :gutter="15">
                <el-col :span="7"><img :src="item.coverImg" width="138" height="138" alt=""></el-col>
                <el-col :span="17">
                  <div class="font24">{{item.productName}}</div>
                  <div class="font14"><div> 引荐 <span>返{{item.yinqian}}%</span></div>  ｜  <div>直签 <span>返{{item.zhiqian}}%</span></div></div>
                  <p>产品介绍：{{item.detail}}</p>
                </el-col>
             </el-row>
          </router-link>
        </el-col>
        
      </el-row>
    </div>
  </div>
</template>
<script>
import { GetPageOfProductByCompany,GetBussinessSubmitCount } from "@/api/product"
export default {
  name: "home",
  data() {
    return {
      page:1,
      pageSize:4,
      message: "",
      tableData:[],
      totalCount:0,
      info:{}
    }
  },
  created() {
    this.search(1)
    GetBussinessSubmitCount().then(res=>{
      console.log(res)
      this.info = res
    })
  },
  methods:{
    search(page){
      GetPageOfProductByCompany(
          page,
          this.pageSize
        ).then(res => {
          this.tableData = res.Data
          this.totalCount = res.TotalCount
        })
    }
  }
}
</script>
<style rel="stylesheet/scss" lang="scss">
.navseds{
  .el-col{
    border-radius: 5px;
    .font14{
      font-size: 14px;
      color: #ffffff;
      margin: 3px auto 0;
    }
    .font30{
      font-size: 30px;
      margin: 0;
      color: #fff;
    }
    &:nth-child(1) .el-card{background-image: linear-gradient(156deg, 
      #7aa0ff 0%, 
      #5448f1 100%), 
    linear-gradient(
      #6256f8, 
      #6256f8);
    background-blend-mode: normal, 
      normal;}
    &:nth-child(2) .el-card{background-image: linear-gradient(156deg, 
		#8cd5ff 0%, 
		#2f8feb 100%);}
    &:nth-child(3) .el-card{background-image: linear-gradient(156deg, 
		#6897f5 0%, 
		#226bfb 100%), 
	linear-gradient(
		#226bfb, 
		#226bfb);
	background-blend-mode: normal, 
		normal;}
    &:nth-child(4) .el-card{background-image: linear-gradient(156deg, 
		#5f56f2 0%, 
		#3229d4 100%), 
	linear-gradient(
		#3229d4, 
		#3229d4);
	background-blend-mode: normal, 
		normal;}
    &:nth-child(5) .el-card{background-image: linear-gradient(156deg, 
		#7fe5ff 0%, 
		#15ace4 100%), 
	linear-gradient(
		#2fb8eb, 
		#2fb8eb);
	background-blend-mode: normal, 
		normal;}
    &:nth-child(6) .el-card{background-image: linear-gradient(156deg, 
		#6edbb8 0%, 
		#3fbe95 100%), 
	linear-gradient(
		#6edbb8, 
		#6edbb8);
	background-blend-mode: normal, 
		normal;}
  }
}
.navseds2{
  margin-top: 40px;
  .font20{
    color: #333333;
    font-size: 20px;
    margin-bottom: 15px;
  }
  .el-col-12{
    margin-bottom: 20px;
    a{
      display: block;
      background-color: #ffffff;
      box-shadow: 0px 0px 8px 0px 
        rgba(43, 61, 86, 0.14);
      border-radius: 5px;
      overflow: hidden;
      padding: 20px;
      box-sizing: border-box;
      .el-col-7{
        width: 154px;
      }
      .el-col-17{
        width: calc(100% - 154px);
        .font24{
          color: #333333;
          font-size: 24px;
          margin-bottom: 15px;
          margin-top: 10px;
        }
        div.font14{
          div{
            display: inline-block;
            margin-right: 12px;
            &:last-child{
              margin-left: 12px;
              margin-right: 0;
            }
          }
          color: #666666;
          span{
            color: #4985e9;
          }
        }
        p{
          font-size: 14px;
          color: #9a9696;
          line-height: 1.6;
          overflow:hidden; 
          display:-webkit-box; 
          -webkit-box-orient:vertical; 
          -webkit-line-clamp:2;
          text-overflow:ellipsis;
           word-break: break-all;
           margin-bottom: 0;
        }
      }
    }
  } 
}
</style>
<style rel="stylesheet/scss" lang="scss">
.flexCon {
  display: -webkit-box;
  display: -webkit-flex;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-pack: center;
  -webkit-justify-content: center;
  justify-content: center;
  -webkit-box-pack: center;
  -webkit-flex-flow: column wrap;
  -ms-flex-flow: column wrap;
  flex-flow: column wrap;
  align-items: center;
}
.hmBox {
  padding-top: 50px;
}
.hmItem {
  position: relative;
  margin-bottom: 35px;
  padding-left: 17px !important;
  padding-right: 17px !important;
}
.homeBox {
  width: 100%;
  height: 215px;
  position: relative;
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  color: #ffffff;
  padding: 10px;
  border-radius: 10px;
  display: flex;
  align-items: center;
}
.homeBox1 {
  background-image: url("https://51shanxiao.com/images/hmBox1Bg1.jpg");
}
.homeBox2 {
  background-image: url("https://51shanxiao.com/images/hmBox1Bg2.jpg");
}
.homeBox3 {
  background-image: url("https://51shanxiao.com/images/hmBox1Bg3.jpg");
}
.homeBox4 {
  background-image: url("https://51shanxiao.com/images/hmBox1Bg4.jpg");
  justify-content: center;
}
.homeBox .el-card__body {
  width: 100%;
}
.homeBox4 .el-card__body {
  width: auto;
}
.homeBox4 h3 {
  margin: 20px 0;
}
.homeBox4 img {
  vertical-align: middle;
  margin-right: 15px;
}
.hmIco {
  padding-right: 10px;
  padding-top: 5px;
  text-align: center;
  height: 50px;
}
.hmIco img {
  max-width: 100%;
}
.hmTit1 {
  font-size: 22px;
  margin: 5px auto;
  font-weight: normal;
}
.hmNum {
  font-size: 22px;
  margin: 5px auto;
}
.hmNum span {
  margin-right: 5px;
  font-size: 37px;
}
.hmBot {
  margin-bottom: 20px;
  display: flex;
}
.hmLef,
.hmRig {
  padding: 0 17px !important;
}
.hmBotBg {
  height: 100%;
  background: #ffffff;
  box-shadow: 0 0 24px rgba($color: #000000, $alpha: 0.1);
  padding: 50px 5%;
  border-radius: 15px;
}
.hmName {
  font-size: 22px;
  color: #333333;
  font-weight: normal;
  margin: 15px 0;
  text-align: center;
}
.cirPercentage {
  margin: 0 auto;
  display: block;
  width: 80%;
  position: relative;
}
.cirPercentage span {
  position: absolute;
  width: 74%;
  height: 74%;
  border-radius: 50%;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  border: 1px solid #f0f0f0;
}
.cirPercentage .el-progress {
  margin: 0 auto;
  display: block;
  width: 100%;
}
.cirPercentage .el-progress-circle {
  margin: 0 auto;
  border-radius: 50%;
  padding: 10px;
  border: 1px solid #f0f0f0;
  width: auto !important;
  height: auto !important;
}
.cirPercentage .el-progress__text {
  font-size: 40px !important;
  color: #333333;
}
.hmBotCir {
  width: 153px;
  height: 153px;
  border-radius: 50%;
  background: rgba($color: #2d96ee, $alpha: 0.1);
  margin: 15px auto 30px;
}
.hmBotCir span {
  display: block;
  width: 100%;
}
.hmBotCir span img {
  max-width: 44%;
  margin: 0 auto;
  display: block;
}
.hmBotNum {
  color: #2f98ef;
  font-size: 20px;
  text-align: center;
}
.hmBotNum span {
  font-size: 37px;
  padding-right: 8px;
}

@media screen and (min-width: 991px) {
}
@media screen and (max-width: 1600px) {
  .hmBox {
    padding-top: 30px;
  }
  .hmItem {
    margin-bottom: 25px;
  }
  .homeBox {
    height: 160px;
  }
  .hmTit1 {
    font-size: 16px;
  }
  .homeBox4 h3 {
    margin: 12px 0;
  }
  .hmNum {
    font-size: 16px;
  }
  .hmNum span {
    font-size: 24px;
  }
  .hmName {
    font-size: 18px;
  }
  .hmBotBg {
    padding: 30px 5%;
  }
  .hmBotCir {
    width: 130px;
    height: 130px;
  }
  .hmBotNum {
    font-size: 18px;
  }
  .hmBotNum span {
    font-size: 32px;
  }
  .cirPercentage .el-progress-circle {
    padding: 7px;
  }
  .cirPercentage .el-progress__text {
    font-size: 34px !important;
  }
}
@media screen and (max-width: 1400px) {
  .homeBox {
    height: 130px;
  }
  .homeBox4 h3 {
    margin: 10px 0;
  }
  .homeBox4 img {
    max-width: 22px;
    margin-right: 8px;
  }
  .hmTit1 {
    font-size: 16px;
  }
  .hmNum {
    font-size: 16px;
  }
  .hmNum span {
    font-size: 24px;
  }
  .hmName {
    font-size: 16px;
  }
  .hmBotNum {
    font-size: 16px;
  }
  .hmBotNum span {
    font-size: 26px;
  }
  .cirPercentage span {
    width: 70%;
    height: 70%;
  }
  .cirPercentage .el-progress__text {
    font-size: 30px !important;
  }
}
@media screen and (max-width: 1199px) {
  .hmBot {
    display: block;
  }
  .hmLef {
    margin-bottom: 20px;
  }
  .cirPercentage {
    max-width: 200px;
  }
}
@media screen and (max-width: 768px) {
  .breadcrumbLocation[data-v-6beed8bc] {
    padding: 10px 15px;
  }
  .hmBox {
    padding-top: 20px;
  }
  .hmItem {
    margin-bottom: 15px;
  }
  .homeBox {
    padding: 0;
    height: auto;
  }
  .hmRigCon {
    display: block;
    overflow: hidden;
  }
  .hmRigItem {
    margin-bottom: 15px;
  }
  .hmBotCir {
    margin: 10px auto;
    width: 120px;
    height: 120px;
  }
}
@media screen and (max-width: 460px) {
  .cirPercentage {
    max-width: 170px;
  }
  .hmBotNum span {
    font-size: 22px;
  }
}
</style>
